package com.api.shopapi.mapper;

import com.api.shopapi.entity.SBJSleepDuration;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface SBJSleepDurationMapper {

    @Insert("insert into sbj_sleep_duration (SleepDurationCode,SleepReportCode,SendDateTime,SleepStatus) values " +
            "(#{sleepDuration.SleepDurationCode},#{sleepDuration.SleepReportCode},#{sleepDuration.SendDateTime},#{sleepDuration.SleepStatus})")
    int insert(@Param("sleepDuration") SBJSleepDuration sleepDuration);


    @Select("select * from sbj_sleep_duration where SleepReportCode=#{sleepReportCode}")
    List<SBJSleepDuration> getListBySleepReportCode(@Param("sleepReportCode") String sleepReportCode);
}
